package com.content.scaffold.common.exception;

import com.content.scaffold.common.web.ResponseCodeEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 数据插入异常
 * @author xiaojl
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class DataModifyException extends RuntimeException {


    Integer code;
    String message;

    public DataModifyException() {
        this(ResponseCodeEnum.DATA_ERROR);
    }

    public DataModifyException(ResponseCodeEnum responseCodeEnum) {
        super(responseCodeEnum.getMessage());
        this.code = responseCodeEnum.getCode();
        this.message = responseCodeEnum.getMessage();

    }

    public DataModifyException(ResponseCodeEnum responseCodeEnum, String message) {
        super(responseCodeEnum.getMessage());
        this.code = responseCodeEnum.getCode();
        this.message = message;

    }
}
